package com.wangdao.wechatmall.bean.vo.admin;

import lombok.Data;

import java.util.List;

/**
 * @ClassName: AdminDataVO
 * @Description ${DESCRIPTION}
 * @Author Xinhao Yi
 * @Date 2021/7/8  21:24
 */

/*
{
    "errno": 0,
    "data": {
        "total": 12,
        "items": [
            {
                "id": 12,
                "username": "Asdadsa",
                "avatar": "'",
                "roleIds": [
                    10,
                    3
                ]
            },
            {
                "id": 5,
                "username": "mall123",
                "avatar": "'",
                "roleIds": [2]
            },
            {
                "id": 4,
                "username": "promotion123",
                "avatar": "'",
                "roleIds": [3]
            },
            {
                "id": 1,
                "username": "admin123",
                "avatar": "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",
                "roleIds": [1]
            }
        ]
    },
    "errmsg": "成功"
}
 */
@Data
public class AdminDataVO<T> {
    Integer total;
    List<T> items;

    public static <T> AdminDataVO<T> ok(Integer total, List<T> items) {
        AdminDataVO<T> adminDataVO = new AdminDataVO<>();
        adminDataVO.total = total;
        adminDataVO.items = items;
        return adminDataVO;
    }
}
